package cn.cjp.m3d27;

import java.util.HashSet;

public class fHashCode {
    public static void main(String[] args) {
        //person 类继承了Object类,可以用O类的hashCode方法
        ePerson person = new ePerson();
        int one = person.hashCode();
        System.out.println(one);

        //HashSet存储Person
        HashSet<ePerson> set = new HashSet<>();
        ePerson p1= new ePerson("aaa",1);
        ePerson p2= new ePerson("aaa",1);
        ePerson p3= new ePerson("bbb",2);
        set.add(p1);
        set.add(p2);
        set.add(p3);
        System.out.println(set.toString());

    }
}
